package com.quarkus.demo;

import com.demo.core.entity.R;
import com.demo.core.event.TestEvent;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.event.Event;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import org.jboss.resteasy.reactive.RestResponse;

@ApplicationScoped
@Path("/event")
@Produces(MediaType.APPLICATION_JSON)
public class EventResource {

    @Inject
    Event<TestEvent> event;


    @GET
    public RestResponse trigger(){
        event.fire(new TestEvent());
        return RestResponse.status(RestResponse.Status.OK);
    }


}
